var EditBlogTypePage = {
	// 删除博客类型成功回调
	'onDeleteBlogTypeSucc':function(data, status, xhr) {
		MsgBox.info(data.message, null, function() {
			findBlogCategoryAjax.send();
		});
	},
	'CATEGORY_STRUCTURE':['codeInfoName','codeInfoValue','ext1','state','orderNumber', 'codeType.codeTypeId','id'],
	// 查询所有博客类型成功回调
	'findCategorySucc':function(data, status, xhr) {
	},
	// 保存博客分类按钮
	'saveBlogType':function() {
		/*if ($("#editCodeInfoFrm").formValidate()) {
			saveTreeCodeInfoAjax.send();
		}*/
		var data = categoryTree.getRecorder().pack(EditBlogTypePage.CATEGORY_STRUCTURE);
		saveTreeCodeInfoAjax.tempUrl(function(url) {
			return url + "/" + "blogType";
		});
		saveTreeCodeInfoAjax.setData($.toJSON(data));
		saveTreeCodeInfoAjax.send();
	},
	'onValueChanged':function() {
		var currNode = categoryTree.getCurrentNode();
		if (!currNode) {
			return;
		}
		if ($("#editCodeInfoFrm").formValidate()) {
			var obj = $("#editCodeInfoFrm").serializeObject();
			$.extend(currNode, obj);
			categoryTree.updateNode(currNode, true);
		}
	},
	'onDrop':function() {
		var currNode = categoryTree.getCurrentNode();
		categoryTree.updateNode(currNode, true);
	},
	// 上次点击的位置
	'lastId':null,
	'onSaveTreeCodeInfoSucc':function(data, status, xhr) {
		$.messager.info("保存成功！");
		categoryTree.getRecorder().clearAll();
		findBlogCategoryAjax.send();
	},
	// 关闭对话框
	'closeDialog':function() {
		var mWindow = MsgBox.getCurrentOpenDialogWindow();
		mWindow.findBlogCategoryAjax.send();
	},
	// 新增博客类型
	'addBlogCategory':function() {
		var pNode = categoryTree.getCurrentNode();
		var newNode = categoryTree.addNode(pNode);
		if (newNode) {
			newNode.state = '1';
			newNode.orderNumber = 1;
			newNode.isParent = true;
		}
		$("#editCodeInfoFrm").autofill(newNode);
	},
	
	'onSelected':function(node) {
		var node = categoryTree.getCurrentNode();
		$("#editCodeInfoFrm").autofill(node);
	},
	// 刷新
	'refreshBlogCategory':function() {
		categoryTree.refresh(true);
		$("#editCodeInfoFrm")[0].reset();
	},
	// 删除节点
	'delBlogCategory':function() {
		var currNode = categoryTree.getCurrentNode();
		if (currNode != null) {
			categoryTree.removeNode(currNode);
			$("#editCodeInfoFrm")[0].reset();
		}
	}
};